// Package model
// @Author zhongxc
// @Date 2024/7/23 15:28:00
// @Desc
package model

import "database/sql"

type UserQueryModel struct {
	Id        int64        `gorm:"column:id" json:"id" form:"id"`
	Nickname  string       `gorm:"column:nickname" json:"nickname" form:"nickname"`
	Username  string       `gorm:"column:username" json:"username" form:"username"`
	Password  string       `gorm:"column:password" json:"password" form:"password"`
	Salt      string       `gorm:"column:salt" json:"salt" form:"salt"`
	Avatar    string       `gorm:"column:avatar" json:"avatar" form:"avatar"`
	Email     string       `gorm:"column:email" json:"email" form:"email"`
	Mobile    string       `gorm:"column:mobile" json:"mobile" form:"mobile"`
	Remark    string       `gorm:"column:remark" json:"remark" form:"remark"`
	Status    int32        `gorm:"column:status" json:"status" form:"status"`
	RoleId    int64        `gorm:"column:role_id" json:"role_id" form:"role_id"`
	DeptId    int64        `gorm:"column:dept_id" json:"dept_id" form:"dept_id"`
	CreatedBy string       `gorm:"column:created_by" json:"created_by" form:"created_by"`
	CreatedAt sql.NullTime `gorm:"column:created_at" json:"created_at" form:"created_at"`
	UpdatedBy string       `gorm:"column:updated_by" json:"updated_by" form:"updated_by"`
	UpdatedAt sql.NullTime `gorm:"column:updated_at" json:"updated_at" form:"updated_at"`
	Deleted   int32        `gorm:"column:deleted" json:"deleted" form:"deleted"`
	DeletedBy string       `gorm:"column:deleted_by" json:"deleted_by" form:"deleted_by"`
	DeletedAt sql.NullTime `gorm:"column:deleted_at" json:"deleted_at" form:"deleted_at"`
	RoleName  string       `gorm:"column:roleName" json:"roleName" form:"roleName"`
	DeptName  string       `gorm:"column:deptName" json:"deptName" form:"deptName"`
}

type UserModel struct {
	Id        int64        `gorm:"column:id" json:"id" form:"id"`
	Nickname  string       `gorm:"column:nickname" json:"nickname" form:"nickname"`
	Username  string       `gorm:"column:username" json:"username" form:"username"`
	Password  string       `gorm:"column:password" json:"password" form:"password"`
	Salt      string       `gorm:"column:salt" json:"salt" form:"salt"`
	Avatar    string       `gorm:"column:avatar" json:"avatar" form:"avatar"`
	Email     string       `gorm:"column:email" json:"email" form:"email"`
	Mobile    string       `gorm:"column:mobile" json:"mobile" form:"mobile"`
	Remark    string       `gorm:"column:remark" json:"remark" form:"remark"`
	Status    int32        `gorm:"column:status" json:"status" form:"status"`
	RoleId    int64        `gorm:"column:role_id" json:"role_id" form:"role_id"`
	DeptId    int64        `gorm:"column:dept_id" json:"dept_id" form:"dept_id"`
	CreatedBy string       `gorm:"column:created_by" json:"created_by" form:"created_by"`
	CreatedAt sql.NullTime `gorm:"column:created_at" json:"created_at" form:"created_at"`
	UpdatedBy string       `gorm:"column:updated_by" json:"updated_by" form:"updated_by"`
	UpdatedAt sql.NullTime `gorm:"column:updated_at" json:"updated_at" form:"updated_at"`
	Deleted   int32        `gorm:"column:deleted" json:"deleted" form:"deleted"`
	DeletedBy string       `gorm:"column:deleted_by" json:"deleted_by" form:"deleted_by"`
	DeletedAt sql.NullTime `gorm:"column:deleted_at" json:"deleted_at" form:"deleted_at"`
}

func NewUserModel() *UserModel {
	return &UserModel{}
}

func (u *UserModel) TableName() string {
	return "sys_user"
}

func (uq *UserQueryModel) TableName() string {
	return "sys_user"
}
